{layout name="../common/master"/}
<div id="right">
       <h4 style="border-bottom: 1px solid #ccc;padding-bottom: 3px">所有任务列表
           <div class="btn-group">
               <a href="{:URL('home/Toolcol/addCrontab')}" type="button" class="btn btn-success">添加新任务</a>
           </div>
       </h4>
    <!--<form action="" method="post" role="form">-->
        <!--<div class="form-group">-->
            <!--<input type="text" style="width: 200px;float: left;margin-right: 20px" class="form-control" value="{if condition='isset($uname)'}{$uname}{/if}" name="uname" id="" placeholder="上传名">-->
        <!--</div>-->
        <!--<button type="submit" class="btn btn-primary">查询</button>-->
        <!--<a href="{:URL('home/Docmanager/docupload')}" class="btn btn-success">上传文件</a>-->
    <!--</form>-->
    <table class="table-bordered table  table-hover" style="margin-top: 20px;">
        <thead>
        <tr>
            <th>ID</th>
            <th>类型</th>
            <th>开始时间</th>
            <th>执行时间</th>
            <th>执行状态</th>
            <th>创建时间</th>
            <th>更新时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {foreach name="data" item="vo" key="k"}
            <tr>
                <th>{$vo['id']}</th>
                <th>{$vo['type']}</th>
                <th>{$vo['start_time']}</th>
                <th>{$vo['exe_time']}</th>
                <th>{$vo['status']}</th>
                <th>{$vo['create_time']}</th>
                <th>{$vo['update_time']}</th>
                <th>
                    <div class="btn-group">
                        <a href="{:URL('home/Active/editBanner',['uid'=>$vo['id']])}" style="margin-left: 5px" uid="{$vo['id']}"  class="btn btn-info btn-sm">修改</a>
                    </div>
                </th>
            </tr>
        {/foreach}
        </tbody>
    </table>

</div>
<script>
    var url="{:URL('home/Active/updateBanner')}"
    $(".up").click(function () {
        var uid=$(this).attr('uid');
        var data={
            uid:uid,
            is_valid:1
        }
        $.post(url,data,function(res){
            res=JSON.parse(res);
            if(res.code==0){
                location.reload();
            }else{
                layer.msg(res.msg,function(){});
            }
        })
    })
    $(".down").click(function(){
        var uid=$(this).attr('uid');
        var data={
            uid:uid,
            is_valid:0
        }
        $.post(url,data,function(res){
            res=JSON.parse(res);
            if(res.code==0){
                location.reload();
            }else{
                layer.msg(res.msg,function(){});
            }
        })
    })
</script>
